<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    </head>
    <body>
        <table border="1px">
            <?php
            foreach ($this->paginator as $unVisiteur):
            ?>
            <tr>
                <td><?php echo $this->escape($unVisiteur['id']); ?></td>
                <td><?php echo $this->escape($unVisiteur['nom']); ?></td>
                <td><?php echo $this->escape($unVisiteur['login']); ?></td>
            </tr>
            <?php endforeach;?>
        </table>
        <?php 
        $pages = $this->paginator->getPages();
//        var_dump($pages);
        if(isset($pages->previous)){
            echo "<a href=?page=$pages->first>Début</a>&nbsp;&nbsp;";
            echo "<a href=?page=$pages->previous>Précédent</a>&nbsp;&nbsp;";
        }
        foreach ($pages->pagesInRange as $page) {
            echo "<a href=?page=$page>$page</a>&nbsp;&nbsp;";
        }
        if(isset($pages->next)){
            echo "<a href=?page=$pages->next>Suivant</a>&nbsp;&nbsp;";
            echo "<a href=?page=$pages->last>Fin</a>&nbsp;&nbsp;";
        }
        ?>
    </body>
</html>
